import React, { useState } from 'react'
import Son from './Son'
import Context from './context'
export default function Index () {
  const [money, setMoney] = useState(100)

  const callback = money => {
    console.log('-Index-', money)
    setMoney(money)
  }
  return (
    <div>
      money is {money}
      <br />
      {/* Index <button onClick={() => setMoney(200)}>change</button> */}
      Index
      <hr />
      <Context.Provider value={{ money, callback }}>
        <Son />
      </Context.Provider>
    </div>
  )
}
